package com.example.openim.utils;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;



/**
 * @description: 校验工具类
 * @author: xhq
 * @create: 2025-11-06 10:24
 */
@Slf4j
@Component
public class PushCheckUtil {

    @Autowired
    private Md5Utils md5Utils;

    @Value("${PUSH.SECRET}")
    private String SECRET;

    public boolean check(String data, String timestamp){
        String s = md5Utils.lowMD5_32(SECRET + timestamp);
        if (data.equals(s)){
            return true;
        }
        return false;
    }

}
